<?php
include '../phpsrc/playgo.php';

if(!isset($_SESSION['user']) ){
?>
<form>
    <span class="error" style="display: none"> please input your name and password correctly</span>
    <label>name</label>:    <input name="username" type="text"><br />
    <label>password</label>:    <input name="password" type="password"> <br />
    <input type="button" class="login-submit" value="submit" >
    
</form>
<?php
}else{
?>
<div class="hall_opertaion_container" >
    <div class="new_room"></div>
    <div class="join_room"></div>
    <span id="pushbutton4" class="yui-button yui-push-button">
        <span class="first-child">
            <input type="button" name="new_room" value="Add" onclick="YAHOO.gosearch.app.addNewGameRoom();">
        </span>
    </span>
    <span id="pushbutton5" class="yui-button yui-push-button">
        <span class="first-child">
            <input type="button" name="join_room" value="Join">
        </span>
    </span>

    <div>
        <?php
        $allRoomStates= getAllRoomStates();
        
        for ($i = 0; $i < count($allRoomStates); $i++) {
        ?>
        <div id="desk-<?php echo $i+1 ?>" class="desk">
            <div class="left-seat">请坐</div>
            <div class="middle-seat">desk <?php print $allRoomStates[$i]['room_num'] ?></div>
            <div class="right-seat">请坐</div>
        </div>
        <?php
        }
        ?>

    </div>
</div>
<div class="hall_table">

</div>

<?php
}
?>